﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyShopCD
{
    public partial class frm_QLDanhMuc2 : Form
    {
        
        public frm_QLDanhMuc2()
        {
            InitializeComponent();
        }
        QuanLyShopCD.BL.cl_Danhmuc clDM;
        //BindingManagerBase bd;
        private void frm_QLDanhMuc2_Load(object sender, EventArgs e)
        {
            clDM = new QuanLyShopCD.BL.cl_Danhmuc(this);
            clDM.Hienthi(null);
        }

        private void bt_themmoi_Click(object sender, EventArgs e)
        {
            //string madm = txt_madm1.Text;
            //string tendm = txt_tendm1.Text;
            clDM = new QuanLyShopCD.BL.cl_Danhmuc(this);
            clDM.them();
            dataGridView1.Refresh();
        }

        private void bt_sua_Click(object sender, EventArgs e)
        {
            //string madm = txt_madm1.Text;
            //string tendm = txt_tendm1.Text;
            clDM = new QuanLyShopCD.BL.cl_Danhmuc(this);
            clDM.sua();
        }

        private void bt_xoa_Click(object sender, EventArgs e)
        {
            string madm = txt_madm1.Text;
            clDM = new QuanLyShopCD.BL.cl_Danhmuc(this);
            DialogResult result;
            result = MessageBox.Show("Ban Co Muon Xoa Danh Muc Co MaDM = '"+madm+"' nay Khong! ","DKM",MessageBoxButtons.OKCancel,MessageBoxIcon.Question);
            if(result==DialogResult.OK)
                clDM.xoa(madm);
            
        }

        private void button8_Click(object sender, EventArgs e)
        {
            DialogResult result;
            result = MessageBox.Show("ban co muon thoat form nay khong!","DKM",MessageBoxButtons.OKCancel,MessageBoxIcon.Question);
            if(result==DialogResult.OK)
                this.Close();
        }      

        private void txt_madm1_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
